package com.apps.ftapp.adapter;


import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;

import com.apps.ftapp.fragment.TabPageFragment;

/**
 * Created by Lly on 2017/10/11.
 */

public class SimplePageAdapter extends FragmentPagerAdapter {

    private String[] names;

    public SimplePageAdapter(FragmentManager fm, String[] names) {
        super(fm);
        this.names = names;
    }

    @Override
    public Fragment getItem(int position) {
        return TabPageFragment.getInstance(position);
    }

    @Override
    public int getCount() {
        return names.length;
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return names[position];
    }


}
